package com.beiyou.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.beiyou.annotation.PageNote;
import com.beiyou.dto.ProductDto;
import com.beiyou.dto.ProductDtoQuery;
import com.beiyou.entity.ProductEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.mybatis.spring.mapper.MapperFactoryBean;

import java.util.List;

/**
 * @author wzby
 * @Date: 2022/10/25 20:22
 */
@Mapper
public interface ProductMapper extends BaseMapper<ProductEntity> {

    @PageNote
    List<ProductEntity> selectXml(ProductDtoQuery productDtoQuery);

    @Update(" update scm_product set status = #{status} where id = #{id}")
    int statusUpdate(Integer id,Integer status);

    @Update(" update scm_product set name = #{name},img = #{img},goodsId = #{goodsId},price = #{price},brief = #{brief},seq = #{seq},lastUpdateBy = #{lastUpdateBy},lastUpdateTime = #{lastUpdateTime} where id = #{id}")
    int update(ProductEntity productEntity);

}
